home *** CD-ROM | disk | FTP | other *** search
/ Beginning Mac Programming / Beginning Mac Programming.bin / pc / Open Me for REALbasic 3 / REALbasic 3.2 / Goodies / 3rd Party Demos / 3rd Party Plugins / Misc / PEVocoder 1.0 (PPC) / PEVocodePlugin Source Code / fft.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-09-12  |  1.5 KB  |  55 lines

  1. /* $Id: fft.h,v 1.2 1998/09/13 00:21:18 emanuel Exp $ */
  2.  
  3. /* (C) Copyright 1993 by Steven Trainoff.  Permission is granted to make
  4. * any use of this code subject to the condition that all copies contain
  5. * this notice and an indication of what has been changed.
  6. */
  7. #ifndef _FFT_
  8. #define _FFT_
  9.  
  10. #include "spt.h"
  11.  
  12. #ifndef REAL
  13. #define REAL double        /* Precision of data */
  14. #endif
  15.  
  16. /* Really ugly hack needed since #if only works on ints */
  17. #define double 1
  18. #define float 2
  19.  
  20. #if REAL==float
  21. #define fft_create_arrays f_fft_create_arrays
  22. #define getx f_getx
  23. #define fft f_fft
  24. #define invfft f_invfft
  25. #define normalize_fft f_normalize_fft
  26. #define fft1n f_fft1n
  27. #define fftn f_fftn
  28. #define invfftn f_invfftn
  29. #define realfftmag f_realfftmag
  30. #define normalize_fftn f_normalize_fftn
  31. #endif
  32.     
  33. #undef double
  34. #undef float
  35.  
  36. void fft_create_arrays(REAL **c, REAL **s, int **rev, int n);
  37. REAL *getx(REAL (*)[2], int, int, int, int *);
  38. void fft(REAL (*x)[2], int n, REAL*c, REAL*s, int *rev);
  39. void invfft(REAL (*x)[2], int n, REAL*c, REAL*s, int *rev);
  40. void normalize_fft(REAL (*x)[2], int n);
  41. void fft1n(REAL (*x)[2], int  nu, int offset, int separation, REAL *c, REAL *s, int *rev);
  42. void fftn(REAL (*x)[2], int n, int *dim);
  43. void invfftn(REAL (*x)[2], int n, int *dim);
  44. void realfftmag(REAL *data, int n);
  45. void normalize_fftn(REAL (*x)[2], int ndim, int *dim);
  46.  
  47. unsigned bitrev(unsigned, int);    /* Bit reversal routine */
  48. int getindex(int, int, int, int *);
  49. int ipow(int, int);
  50. int ilog2(int);
  51.  
  52.  
  53.  
  54. #endif /* _FFT_ */
  55.